#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
	int a = 0;
	int n = 5;
	int i= 0;
	int num = 0;
	int Sn = 0;
	scanf("%d", &a);
	for (i = 0; i < 5; i++)
	{
		num = num * 10+a;
		Sn = Sn + num;
	}
	printf("%d\n", Sn);
	return 0;
}